package collection;

public class Vertex<V,E> extends ANode<V>{

	private HashSet<Edge<E,V>> edgeSet;
	
	public boolean isVisited = false;
	
	public Vertex(V element)
	{
		super(element);
		this.edgeSet = new HashSet<Edge<E,V>>();
	}
	
	public void addEdge(Edge<E,V> edge)
	{
		this.edgeSet.add(edge);
	}
	
	public void removeEdge(Edge<E,V> edge)
	{
		this.edgeSet.remove(edge);
	}
	
	public boolean hasEdge(Edge<E,V> edge)
	{
		return this.edgeSet.contains(edge);
	}
	
	public boolean hasNoEdges()
	{
		return this.edgeSet.isEmpty();
	}
	
	public HashSet<Edge<E,V>> getEdges()
	{
		return this.edgeSet;
	}
	
	@Override
	public void clear()
	{
		super.clear();
		this.edgeSet = new HashSet<Edge<E,V>>();;
	}
	
}
